import { createRouter, createWebHistory } from 'vue-router'
import SdyHome from '@/views/SdyHome/index.vue'
import SdyCate from '@/views/SdyCategory/index.vue'
import SdyCart from '@/views/SdyCart/index.vue'
import SdySelf from '@/views/SdySelf/index.vue'
import NotFound from '@/views/NotFound/index.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path:'/',
      redirect:'/home'
    },
    {
      path:'/home',
      name:'home',
      component:SdyHome
    },
    {
      path:'/cate',
      name:'cate',
      component:SdyCate
    },
    {
      path:'/cart',
      name:'cart',
      component:SdyCart
    },
    {
      path:'/self',
      name:'self',
      component:SdySelf
    },
    {
      path:'/search',
      name:'search',
      component:()=>import('@/views/SdySearch/index.vue'),
      meta:{hidFooter:true}
    },
    {
      path:'/list',
      name:'list',
      component:()=>import('@/views/SdyGoodsList/index.vue'),

    },
    {
      path:'/detail',
      name:'detail',
      component:()=>import('@/views/SdyDetail/index.vue'),

    },
    {
      path:'/not-found',
      name:'not-found',
      component:NotFound,
      meta:{hidFooter:true}
    },
    {
      path:'/:pathMatch(.*)*',
      component:NotFound
    }

  ]
})

export default router
